<%@page import="com.dfhc.ISystemConstant"%>
<%@page import="org.framework.rm.role.IRoleConstants" %>
<%@page import="com.dfhc.util.StringHelper"%>
<%@page import="com.dfhc.util.CryptoHelper"%>
<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />

<!-- 全局js 和css包 -->
<%@ include file="/jsp/include/web/new/global.jsp" %>
<title>添加角色 </title>

<%@ taglib uri="/dfhc" prefix="dfhc" %>
</head>
<body>


<article class="page-container">
















	<form action="" method="post" class="form form-horizontal" id="form-rmrole-add">
	   <input type="hidden" id="id" name="id" value="${bean.id}">
							
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><dfhc:span templateId="h_ui_not_null_span"></dfhc:span><%=IRoleConstants.TABLE_COLUMN_DISPLAY.get("roleCode")%>：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_input" value="${bean.role_code}" placeholder="" id="role_code" name="role_code"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><dfhc:span templateId="h_ui_not_null_span"></dfhc:span><%=IRoleConstants.TABLE_COLUMN_DISPLAY.get("name")%>：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_input" value="${bean.name}" placeholder="" id="name" name="name"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><dfhc:span templateId="h_ui_not_null_span"></dfhc:span><%=IRoleConstants.TABLE_COLUMN_DISPLAY.get("enableStatus")%>：</dfhc:title>	    
			<dfhc:div templateId="h_ui_div_fromcontrol">
				<dfhc:select templateId="h_ui_select" size="1" name="enable_status" id="enable_status" pleaseSelect="1" defaultValue="${bean.enable_status}" sqlOption="code" code="RM_ENABLE_STATUS" />				
			</dfhc:div>
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><dfhc:span templateId="h_ui_not_null_span"></dfhc:span><%=IRoleConstants.TABLE_COLUMN_DISPLAY.get("isSystemLevel")%>：</dfhc:title>	    
			<dfhc:div templateId="h_ui_div_fromcontrol">
				<dfhc:select templateId="h_ui_select" size="1" name="is_system_level" id="is_system_level" pleaseSelect="1" defaultValue="${bean.is_system_level}" sqlOption="code" code="RM_YES_NOT" />				
			</dfhc:div>
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><%=IRoleConstants.TABLE_COLUMN_DISPLAY.get("description")%>：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_input" value="${bean.description}" placeholder="" id="description" name="description"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
							
		<dfhc:div templateId="h_ui_div_row_cl">
			<dfhc:div templateId="h_ui_div_pop_up_button">
				<dfhc:button templateId="h_ui_submit_button" />
			</dfhc:div>
		</dfhc:div>
	</form>
</article>



<script type="text/javascript">
$(function(){
	//获取新id
	<c:if test="${empty bean}"> 
	$('#id').val(getNewId('<%=IRoleConstants.TABLE_NAME%>'));
	</c:if>


	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-rmrole-add").validate({
		rules:{
			roleCode:{			
				required:true,
				minlength:1,
				maxlength:200
			},
			name:{			
				required:true,
				minlength:1,
				maxlength:200
			},
			enableStatus:{			
				required:true,
				minlength:1,
				maxlength:1
			},
			isSystemLevel:{			
				required:true,
				minlength:1,
				maxlength:1
			},
			isRecursive:{			
				maxlength:1
			},
			matrixCode:{			
				maxlength:1000
			},
			description:{			
				maxlength:1000
			},
			functionPermission:{			
				maxlength:4000
			},
			dataPermission:{			
				maxlength:4000
			},
			usableStatus:{			
				maxlength:1
			},
			modifyDate:{			
			},
			modifyIp:{			
				maxlength:45
			},
			constraint:{			
			}
		},
 		messages: {
			roleCode:{
		        required: "请输入ROLE_CODE",
		        minlength: "ROLE_CODE至少由1个字母组成",
		        maxlength: "ROLE_CODE最大长度为200个字母"
	           },
			name:{
		        required: "请输入NAME",
		        minlength: "NAME至少由1个字母组成",
		        maxlength: "NAME最大长度为200个字母"
	           },
			enableStatus:{
		        required: "请输入ENABLE_STATUS",
		        minlength: "ENABLE_STATUS至少由1个字母组成",
		        maxlength: "ENABLE_STATUS最大长度为1个字母"
	           },
			isSystemLevel:{
		        required: "请输入IS_SYSTEM_LEVEL",
		        minlength: "IS_SYSTEM_LEVEL至少由1个字母组成",
		        maxlength: "IS_SYSTEM_LEVEL最大长度为1个字母"
	           },
			isRecursive:{
		        maxlength: "IS_RECURSIVE最大长度为1个字母"
	           },
			matrixCode:{
		        maxlength: "MATRIX_CODE最大长度为1000个字母"
	           },
			description:{
		        maxlength: "DESCRIPTION最大长度为1000个字母"
	           },
			functionPermission:{
		        maxlength: "FUNCTION_PERMISSION最大长度为4000个字母"
	           },
			dataPermission:{
		        maxlength: "DATA_PERMISSION最大长度为4000个字母"
	           },
			usableStatus:{
		        maxlength: "USABLE_STATUS最大长度为1个字母"
	           },
			modifyDate:{
	           },
			modifyIp:{
		        maxlength: "MODIFY_IP最大长度为45个字母"
	           },
			constraint:{
	           }
	    },		
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			<c:if test="${empty bean}"> 
			var url = getRootPath()+'<%=CryptoHelper.encryptUrl(request,"/rmrole/insert")%>?jsguid='+$('#id').val();
			</c:if>
			<c:if test="${not empty bean}"> 
			var url = getRootPath()+'<%=CryptoHelper.encryptUrl(request,"/rmrole/update")%>?jsguid='+$('#id').val();
			</c:if>
			//提交成功关闭
			submitAjax(url,$("#form-rmrole-add").serialize(),getRootPath()+'<%=CryptoHelper.encryptUrl(request,"/rmrole/insert")%>'); 		    		    		
		}
	});
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
